
export default {

    //获取当前用户
    getUser: function () {
        //return localStorage.getItem('user');
        return sessionStorage.getItem('user');
    },
    //新增用户
    addUser: function (username, authType) {
        var user = new Object();
        user.username = username;
        user.authType = authType;
        //localStorage.setItem('user', JSON.stringify(user));
        sessionStorage.setItem('user', JSON.stringify(user));
    },
    //移除用户
    removeUser: function () {
        //localStorage.removeItem('user');
        sessionStorage.removeItem('user');
    },
    //更改用户
    changeUser: function (username, authType) {
        var user = new Object();
        user.username = username;
        user.authType = authType;
        //localStorage.setItem('user', user);
        sessionStorage.setItem('user', user);
    }

}

